require 'weborb/context'
require 'weborb/io/binary_reader'

class SaveFile
 
    def doSave (filedata)
	reader = BinaryReader.new filedata
	binary_string = reader.read_string(filedata.length)
	t = Time.now
        filename = Dir::tmpdir + "/" + t.to_i.to_s + t.usec.to_s + ".jpg"
	File.open(filename, "wb") {|new_file| new_file.write(binary_string)}
	filename
    end 

end